﻿@model Filters

@if (Model.HasError)
{ 
    <script type="text/javascript">
        var modelData = @Html.Raw(Json.Encode(Model.DataError.ErrorMessages));
        showModalDialogDataError(modelData, "@((int)Model.DataError.ErrorType)");
    </script>
}

@if (Model.HasChanged != null && Model.HasChanged.Count != 0)
{ 
    <script type="text/javascript">
        try
        {
            @foreach(var item in Model.HasChanged)
            {
                @:filterItemOnChange('@item.HtmlID()', '@item.State');//title: @item.Title, newState: @((FilterItem.FilterState)item.State)
            }
        }
        catch(err)
        {
            alert(err);
        }
    </script>
}